/**
 * @file 详情页mock数据
 * @author liushuang(liushuang04@baijia.com)
 * @date 2019-11-15
 */

const { mock, Random } = require('mockjs');

// 节点
const point = {
    'xAxis|+1': ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    'value|+1': 1 + 10
}

// 数据map
const dataMap = {
    'name|+1': ['折线1', '折线2', '折线3', '折线4', '折线5', '折线6', '折线7'],
    'point|7': [point]
}

const menu = require('./json/menu.json');
const menuEmpty = require('./json/menuEmpty.json');
const menuNoAnalysis = require('./json/menuNoAnalysis.json');

const selectJson = require('./json/report/select.json');

const onlineDetail = require('./json/report/onlineDetail.json');
const onlineSearch = require('./json/report/onlineSearch.json');
const testSearch = require('./json/report/testSearch.json');

// 行课mock数据
const xingkeDetail1 = require('./json/report/hangkeDetail1.json');
const xingkeDetail2 = require('./json/report/hangkeDetail2.json');
const xingkeDetail3 = require('./json/report/hangkeDetail3.json');
const dynamicDetail = require('./json/report/dynamicDetail.json');
const salesHaokeDetail = require('./json/report/salesHaokeDetail.json');
const testDetail = require('./json/report/testDetail.json');

module.exports = {
    'POST /api/portal/menu': mock(
        menu
        // menuEmpty
        // menuNoAnalysis
    ),
    'POST /api/portal/detail': mock(

        xingkeDetail1
    ),
    'POST /api/portal/download': mock({
        'code': 0,
        'msg': null,
        'data': null,
        'pager': {
            "pageNum": 1,
            "pageSize": 50,
            "count": 100
        }
    }),
    'POST /api/portal/map': mock({
        'code': 0,
        'msg': null,
        'data|7': [dataMap],
        'pager': {
            "pageNum": 1,
            "pageSize": 50,
            "count": 100
        }
    }),
    'POST /api/portal/select': mock(selectJson),
    'POST /api/portal/search': mock(
        onlineSearch
        //testSearch
    ),
    'POST /api/portal/reportList': mock({
        'code': 0,
        'msg': null,
        'data': {
            "idList": [234, 254],
        },
        'pager': {
            "pageNum": 1,
            "pageSize": 50,
            "count": 100
        }
    }),
    'POST /api/portal/test': function({url, type, body}){
        console.log(url, type, body);
        return mock({
            code: 1,
            test: 2
        });
    }

};
